package com.example.extenddemo.extendsDemo;

import com.example.extenddemo.entity.MyMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class MyListener {

    @EventListener
    public void onMessage(MyMessage msg){
        log.info("监听到消息：{}",msg);
    }
}
